home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-27 | 56.0 KB | 1,320 lines |
- ---------------------------------------------------------------------------
-
- A m o k E d
- ===================
-
- Version 1.30
-
- ---------------------------------------------------------------------------
-
- AmokEd V1.30 Copyright 1990-1992 Hartmut Goebel, All Rights Reserved
-
- [ AmokEd V1.20 Translated English Documentation Copyright 1992
- F. Sullivan Segal, All Rights Reserved, except as noted below. ]
-
- This entire package is designated Freeware. You may copy and distribute
- it as often as you like with the following limitations:
-
- * The package must remain complete and unchanged
- * This package must not be distributed for profit. Distribution by
- diskette is forbidden to exceed DM 5.00 (ca. $4).
- * Donations are welcome.
- * It is expressly forbidden to use this program, or any programs or
- data developed using this program to directly or indirectly
- benefit the military.
- * The following persons or firms are prohibited from distributing
- this package, either in full or in part:
- Fa. Stefan Ossowski, Fa. Karstadt
-
- The Author:
-
- Hartmut Goebel
- Aufseplatz 5 UseNet: hartmut@oberon.nbg.sub.org
- (W-)8500 NÜrnberg 40 Z-Netz: HARTMUT@ASN.ZER
- Deutschland Fido: Hartmut Goebel of 2:2400/111
-
-
- For Translation information:
- F. Sullivan Segal
- SnailMail: InterNet:
- 38000 Camden St #97 fletcher@netcom.com
- Fremont, CA 94526
- U.S.A ]
-
-
- I owe thanks to the following people:
-
- - Matthew Dillon: for his original DME
- - Volker Rudolph: for numerous tips, routines, and moral support
- - Werner Speer: for help in getting started in the form of the first
- parser
- - Tobias Ruland: for help with assembler things
- - Thomas Wagner: for creative beta-testing
- - Jrgen Walleneit: for the disk icon
- - have I forgotten anyone? Then thanks to you as well!
-
- ---------------------------------------------------------------------------
-
- Contents
-
- I Introduction
- Invocation, the configuration file
- II Macros
- III Keymaps
- IV How to load and save files
- V Workbench support
- VI ARexx support
- VII The application port
-
- ----------------------
- ---------- I ----------
- ---------- Introduction ----------
- ----------------------
-
- AmokEd is a free programmable editor. It is based on the well known
- DME editor created by Matthew Dillon, using many fartures of AmigaOS
- 2.0. It supports several capabilities which have made it quite a
- challenging (programming) project to complete. Here is a quick
- overview:
-
- - A rich command language. Commands can be entered directly, or
- mapped to the keyboard and then executed automatically each time
- the key is pressed. (Each key can be bound in combination with
- various qualifiers and mouse buttons for a total of 128 macros for
- each key!) Each key and button combination can be set
- individually.
-
- - An Arexx interface makes it possible to use AmokEd as a component
- of a much more complex system. Through the use of external macros,
- even external programs can be controlled.
-
- - A special Arexx-based application port makes it easy to create
- application related extensions which should not blow up AmokEd.
-
- - Variables make the macro language very flexible. (e.g: Macros can
- be kept in a variable and then executed). Environment variables
- are also supported (ENV:).
-
- - The user can define pull-down menus that work with all of the
- normal macros and variables. Check menus (including the checkmark)
- can even be built.
-
- - Scrolling is very fast, and now there are also scroll gadgets and
- a scroll bar.
-
- - The title line of each window includes information about the text
- being edited: file name, actual cursor position, modification
- status of the text ...
-
- Future versions will eventually allow the user the specify which
- information should be displayed.
-
- - Numerous files can be opened and edited in separate windows at
- once. Windows can be iconified. The next version will also allow
- you to edit the same file from different windows.
-
- - AmokEd is rentrant and can be made resident. (See the 'resident'
- command in the AmigaDos manual).
-
- Amoked was developed to correct some of the deficiencies of DME,
- and to further develop the capabilities of that program. AmokEd was
- written in Oberon, a strongly typed language. It is the author's hope
- that the rigorous nature of this language will aid in future
- development. Much development is made even easier through the
- inclusion of the application port.
-
- AmokEd can be invoked with any number of filenames as arguments.
- These files are loaded automatically as the program starts up.
-
-
- AmokEd now needs AmigaOS2.0 or higher!!
-
- Invocation
- ----------
-
- AmokEd is quite easy to load:
-
- from the CLI: AmokEd {Template}
-
- Template:
- FILES/M,SETTING/K,SOURCE/K,
- SD=SCREENDEPTH/K/N,PS=PUBSCREEN/K,PORTNAME/K,
- NOAPPMENU/S,
- LEFTEDGE/K/N,TOPEDGE/K/N,WIDTH/K/N,HEIGHT/K/N
-
- from WorkBench: click on the icon (multiple selections are permitted)
- The ToolTypes accord with the long forms of the CLI-options.
-
-
- SETTING <file> config file to be used
- SOURCE <name> use file <name> to initialize instead of the one
- defined in the configfile
- SD=SCREENDEPTH N open a screen with N bitplanes ( 2**N colors)
- PS=PUBSCREEN <name> name of the public screen, AmokEd should
- open respectively should open its windows on
- PORTNAME <name> name to be used for the Arexx port
- NOAPPMENU do _not_ generate an entry for Workbench's
- Tools menu
- LEFTEDGE N Horizontal window position x = N
- TOPEDGE N Vertical window position y = N
- WIDTH N Window width = N
- HEIGHT N Window height = N
-
-
- Submitting an empty string ("") as <name> parameter will force
- AmokEd to use the defaults.
-
- If a screen respectivly a port with the given name already
- exists, the name will be made unique by appending a number,
- e.g. MyScreen.2.
- Default names _always_ are appended by a number.
-
- If AmokEd does not open its windows on Workbench's screen there
- an entry to WB's Tools menu is be generated. If this entry is
- selected AmoEd will bring the screen to front and activate the
- text window last recently used.
- The option NOAPPMENU suppresses this entry.
-
- If AmokEd opens its windows on Workbench you can drop icons
- into them (AppWindows). AmokEd tries to load the related files.
- Hereby the configuration for the new window(s) (window sizes,
- local switches etc.) will be cloned from the window the icons
- are dropped into.
-
-
- The Configuration File
- ----------------------
-
- AmokEd can save some parameters in a configuration file. The configs
- in this file can be partly altered via ToolTypes or shell options,
- partly manipulated via makro commands.
-
- At the moment AmokEd saves the following informations:
- - window position and size, number of bitplanes
- - position and size of the filerequester
- - tabsize
- - status of the toggles WordWrap, SaveTabs, InsertMode, IgnoreCase,
- SaveIcons, NoAppMenu
- - name of screen, ARexx port and init file (only if the defaults
- have been overwritten)
-
- The search order for the config file is (if SETTING is not given):
- 1) AmokEd.config in the current dir
- 2) the file given in the environment variable `AmokEdConfig'
- 3) AmokEd.config in the directory where AmokEd resides *)
- 4) ENV:AmokEd/AmokEd.config
-
- *) not possible if AmokEd is held resident
-
- It is recommended to submit an init file for the very first call
- of AmokEd (via option/ToolType SOURCE) and save the configuration.
-
-
- -------------------------
- -------- II ----------
- -------- Macros ----------
- -------------------------
-
- The behaviour of AmokEd can be greatly customized to the user's
- wishes through a large number of built-in commands. Sets of commands
- can be combined and referred to as a single macro. These macros can
- then be reused in turn to create higher order macros.
-
- Each command consists of a keyword, and a *fixed* number of
- arguments (between zero and three). Between the keyword, and
- separating each argument is one or more spaces. To build an argument
- that contains a space, the argument can be enclosed in parentheses.
-
- E.g:
- (this is a single argument)
- these are four arguments
-
- Alternatively the argument can be surrounded by open and closed
- single quotes (`').
-
- Text that is to be included verbatim is likewise surrounded by
- either parens or quotes.
-
- Commands are not case sensitive, nor are most arguments. The
- exceptions are build-in variables( qqv.), internal keyboard-key
- references (qqv.), and literal text. In the examples below, the
- following rules apply:
-
- right - move the cursor right. No parameters.
- return - end the line. No parameters
- map <key> <binding> - map a binding to a keyboard key. Two parameters.
-
- Macro Examples:
- right right (Hallo) right right (Hallo) return
- map f3 (up right) map f5 (down left)
- map f10 ((Hallo))
-
-
- As you can see illustrated above, if a command doesn't need any
- arguments, it doesn't take any. The interpreter continues with the
- next keyword as the next separate command. By surrounding the word
- 'Hallo' in parenthesis above, you are telling the interpreter that
- this is literal text. The literal text will be added to the document
- at what ever position the cusor is left in after moving twice right
- its location at macro invocation.
-
- One more because it is really important:
-
- The 'map' command takes two arguments. The first argument is the
- key to bind (e.g: f3), the second is the set of macro commands to
- execute. The commands 'up' and 'right' will be bound to the 'f3'
- key. At the first iteration, the parentheses which turn 'up' and
- 'right' into a single parameter are removed, and the results are
- put into 'f3'. When the user later presses the 'f3' key, the
- commands will be interpreted and executed individually.
-
- map f5 right - In this case 'right' is only one
- word, and doesn't need any parens.
-
- map f5 (right right) - <f4> is mapped to move the cursor
- right twice. If the parens had been
- left out, the commands wouldn't be
- combined into a single parameter,
- so the last right would have been
- performed immediately, and not mapped.
-
- map c-del `repeat cright del' - Equivalent to the 'remeol' command
- (qqv.).
-
- Some of these arguments end up going through the command
- inrepreter multiple times.
-
- The 'map' command is a good example. While the 'map' command is
- being interpreted, the interpreter looks ahead to pull out the
- arguments it will need for the command. The interpreter then looks
- at the command again when the key is pressed. Thus if you want to
- bind a key which will insert text into your file, you have to
- surround the text is a double set of parentheses. The first set is
- removed on the initial pass through the interpreter. If none were
- left during the second pass the interpreter would be unable to
- recognize the command, and issue an error.
-
- Some more complex examples follow:
-
- map f4 (right right (Hallo) wleft) *RIGHT*
- map f4 right right (Hallo) wleft *WRONG*
-
- map f4 (map f4 ((Hallo))) - Builds a binding for <f4> which will
- reprogram the key after the first time
- it is pressed which will output the
- text 'Hallo' the after the second.
-
- map c-i (repeat tr (( ))) - In this example you can see how a
- literal space character can be
- included in a 'repeat' command
- embedded in a 'map' command. (The
- space ends up going through the
- interpreter 3 times before being
- interpreted as an actual space. Count
- the closing parentheses.)
-
-
- An easy way to test commands or key-map changes, is either to press
- the escape key (which will bring up the command-line), or under the
- default keymap, to press 'a-S' (<Alt><Shift>S) which causes the line
- under the cursor to be interpreted as a command.
-
- In other words, AmokEd can be used as its own debugger, to help you
- to build and test new key-maps and macros.
-
-
- ---------- STRING VARIABLES ----------
-
- String variables are replaced with their contents. There are three
- ways of referencing a variable:
-
- $varname - The variable must be alpha-numberic (ie: it must
- consist of the letters 'A-Z', 'a-z', '0'-9', '_' or
- '-'.)
- $(varname) - The variable name can have any symbols except the
- parentheses symbols.
- $`varname' - The variable name can have any symbols except the
- open and closed quote marks.
-
- The alternative forms of variable name references make it possible
- to have unusual variable names, such as those which include spaces,
- or periods, or other junk.
-
- There are several special variables:
-
- filename - current file name (only filepart)
- path - full path to the files directory
- modified - modification state of the text
- scanf - the last scanned string (q.v. Command SCANF).
- portname - name of the AmokEd ARexx-port
- screenname - name of the public screen
- findstr - current search string
- repstr - current replacement string
- lineno - current line number [1..n]
- colno - current row number [1..n]
- margin - margin column (q.v Command MARGIN).
- currentline - contents of the current line
- winleft, wintop, winwidth, winheight
- - actual window position ans size (in pixels)
- tmpleft, tmptop, tmpwidth, tmpheight
- - the values set with TMP* (in pixels)
-
- Other variable names are resolved using the following search order:
-
- (1) Internal variables (q.v: SET, UNSET).
- These variables are stored as local variables of the current
- process and removed when closing AmokEd.
- (2) Global environment variables (q.v: SETENV, UNSETENV).
- (3) AmokEd keymap macros, or menu definitions. In this way you can
- re-use a key definition in another key definition. For example,
- $sa-tab would include the current definition of the <Shift><Alt>
- <Tab> key in the command that is being interpreted.
- (4) If ARexx is installed and running, the macro is handed over to
- the Rexx interpreter.
-
- Variable of kind (1) and (2) are not case sensitive for compatibility
- with AmigaDos.
- __________________________________________________________________________
-
- NOTE: What is wrong with this command?
-
- repeat 100 (first ($myvar))
-
- The problem is that the variable 'myvar' is expanded at the first
- iteration of the interpreter. If the variable were to contain
- something such as an open parenthsis '(', the command would end up
- looking like this:
- repeat 100 (first (())
-
- If you count parens, you will notice that there are more open
- parens than closed. This is obviously not what the macro writer had
- in mind. By replacing the '$' with '\$' the expansion of the variable
- can be delayed one iteration.
-
- repeat 100 (first (\$myvar))
-
- Here on the first iteration, '\$myvar' is reduced to '$myvar'.
- When the entry is again looked at by the interpreter (as literal text
- following the 'first' command) the variable will be expanded and used
- correctly.
-
- Problems like this are especially evident when you are redefining
- keys. In all probability if you include a variable in a macro, you
- won't want the value of the variable bound literally into the
- command, otherwise it you wouldn't be able to change it without
- redefining the whole key.
-
- On the other hand it is entirely legal:
-
- set x (tlate +1)
- map f5 (repeat 100 ($x))
-
- Whatever the value of 'x' is changed to later, <f5> will always
- perform the command '(tlate +1)' a hundred times...
-
- Had the variable been left outside parentheses (except for the
- syntax problems it would introduce), the variable would have been
- interpreted as an immediate command, and not given to the repeat
- command as text.
-
- -------- SPECIAL CHARACTERS ---------
-
- `^' The carat is used for control characters.
- Eg: ^c is used to represent <Control>C (Ascii 03)
- The NUL character, ^@, is not supported, since it is used internally
- as an end of line marker.
-
- `\' The backslash overrides the special meaning of the following
- character.
- Eg: map c-a ((^l)) - makes <Control>A produce Ascii 12
- map c-a ((\\\^l)) - makes <Control>A produce the string '^l'
- (carat-l). The first '\' makes the
- second a literal backslash. The third
- overrides the carat. The key is
- thereby defined to be '\^l'.
-
-
- --------- COMMAND LIST ---------
-
- # -The rest of the line is comment
- (text) -Output text as if it had been typed
- keyname -executes a keymapped key definition as a macro
- header-item -executes a menu selection as a macro (Eg: Project-Save)
- ABORT -stops macro execution
- APPL -starts an application (qv: Section VII, Application-Port)
- APPLCLOSE -stop an application (qv: Section VII, `Application'-Port)
- ARPBSAVE -BSAVE FileRequester \
- ARPINSFILE -INSFILE FileRequester |
- ARPLOAD -NEWFILE FileRequester | if ASL-Lib is installed
- ARPSAVE -SAVEAS FileRequester |
- ARPSAVECFG -SAVECONFIG FileRequester |
- ARPSOURCE -SOURCE FileRequester /
- ASCII -returns the ASCII value of the character under the cursor
- BACK -the same as BS
- BACKTAB -Back up one tab spacing
- BCOPY -copy the marked block to the line before the current one
- BDELETE -delete the marked block from the text
- BLOCK -mark the beginning or end of a block
- BMOVE -move the marked block to the line before the current one
- BOTTOM -jump to the end of the file
- BS -`backspace' (delete to the left of the cursor)
- BSAVE file -save the block in the named file <file>
- BSOURCE -execute the marked block as if it were a macro file
- CD dir -change the current directory
- CHECKRESET hdr-item
- -removes the checkmark from a menu item
- CHECKSET hdr-item
- -turns on the checkmark for a menu item
- CHECKTOGGLE hdr-item
- -toggles the checkmark in a menu item
- CHFILENAME name -changes the working name of the file
- CLEARMAP -deletes the keymap, and reinstates the defaults.
- DEL -`delete' (delete the character under the cursor)
- DELINE -delete a line (qv: UNDELINE)
- DOWN -Cursor down
- DOWNADD -Cursor down. If at the end of the file, add a line to file
- ESC -Enter a direct command line
- ESCIMM arg -Enter a direct command line the argument text all ready
- entered
- EXECUTE comm -Execute a CLI command **)
- FIND string -set the search string (qv: NEXT)
- FINDR fstr rstr -set the replace string (qv: NEXTR)
- FINDSTR -set the search string
- FIRST -jump to column 1 (the first)
- FIRSTNB -jump to the first non-blank column
- GOTO BLOCK -jump to the beginning of the marked block (or the beginning
- of the file.)
- GOTOCOL -put the cusor at column N (counting from 1)
- GOTO END -jump to the end of the marked block (no motion if unmarked)
- GOTO START -equivalent to GOTO BLOCK
- GOTO [+/-]n -jump forward or backward N lines from the current position
- HEIGHT n -sets the height of all new windows in pixels
- ICONIFY -iconify the window (see below)
- IF cnd act -IF/WHILE/IFELSE .. flow control (see below)
- IFELSE cnd ifact elseact
- -(see below)
- INDENT -indents a line further in (see UNINDENT, and INDENT below)
- INSERT text -inserts text before the cursor independently of the current
- setting of InsertMode
- INSFILE file -reads and inserts a file before the current line
- INSLINE -inserts a line before the current one
- JOIN -joins the next line and the current one together
- JUSTIFY type -left and right justifies the line with a width of $margin
- <type> = FULL -> justify full
- (others are not implemented now)
- LAST -jumps to just after the last non-blank character on the line
- LEFT -move the cursor left
- LEFTEDGE n -sets the initial location of the left edge of all new windows
- in pixels.
- MAP key map -overlays a key with an interpreted value
- MARGIN n -sets the right margine for automatic word-wrap and reformat (qqv.)
- MATCHBRACKET -finds matching bracket
- MENUADD hdr item cmd
- -adds a pull down menu item
- MENUADDSEP hdr -adds a separator line to the menu
- MENUADDT hdr item cmd
- -adds a menu item with a check-mark
- MENUCLEAR -deletes all mouse menus
- MENUDEL hdr item -deletes a single menu item
- MENUDELHDR hdr -deletes all items under a single menu
- MENUOFF -disables menus (multiple calls are maintained)
- MENUON -enables menus (menus are only enabled if all MENUOFF commands
- have been offset.
- MULTIREPLACE f s -interactive search and replace
- MYPRI n -change the task priority to N (-128 .. 127)
- NEWFILE file -change the current file to a new file <file>
- NEWWINDOW -open a new editor window (see LEFTEDGE, TOPEDGE, WIDTH, HEIGHT)
- NEXT -search for the next occurrence of a string (see FIND, FINDSTR)
- NEXTR -search and replace the next string (see FINDR, FINDSTR, REPSTR)
- NEXTWIN -activate the next text-window *)
- NOSCRUPDATE -disable screen updates for the duration of this macro
- NULL -do nothing (see IFELSE, etc.)
- OBERROR action -error funcions for AmigaOberon (see below)
- OVERWRITE text -overwrites text in the document with the text given independently
- of the current setting of insert mode.
- PAGEDOWN -move one page downwards (see PAGESET)
- PAGESET n -set the page size for PAGEUP, and PAGEDOWN to n% of the window size
- PAGEUP -move one page upwards (see PAGESET)
- PING n -set a text marker (0 .. 9)
- PONG n -jump to the previously set text marker (0 .. 9) *)
- PREV -jump to the previous cursor position that was found using the
- string search function (FIND, NEXT)
- PREVR -jump to the previous cursor position that was used for a search
- and replace function (FINDR, NEXTR)
- PREVWIN -activate the previous window *)
- POPMARK -retrieve the marked block previously pushed. (PUSHMARK)
- PURGEMARK -remove a pushed block from memory.
- PUSHMARK -store the marked block in memory, and unmark the block.
- QUIT -exit without saving
- RECALL -opens the command line, and shows the previously executed command.
- This command must be mapped to a key (eg: c-esc)
- REFORMAT -Reformats the paragraph until either an empty line is encountered,
- or a line that is indented further.
- REMSOL -Remove all text between the cursor and the beginning of the line
- REMEOL -Remove all text between the cursor and the end of the line
- REPEAT cnd comm -(see below)
- REPSTR string -sets the replacement string
- RESETTOGGLE toggle
- -deletes a memory toggle (see below)
- RESIZE cols rows -change the size of the current window (e.g: resize 70 23)
- RETURN -the same as (FIRST DOWNADD)
- RIGHT -Move the cursor one column to the right
- RX -activate an ARexx macro without arguments (RX makroname) (see below)
- RX1 -activate an ARexx macro with one argument (RX makroname arg)
- RX2 -activate an ARexx macro with two arguments (RX makroname arg1 arg2)
- RXS -activate an ARexx command directly
- SAVEAS file -save the current text to a named file
- SAVECONFIG -save the current configuration (including window size) to the default
- configuration file
- SAVEMAP file -save the users keymap overlay to a file
- SAVEOLD -save the current text under its current name
- SAVESMAP file -save all mapped keys including those that are mapped by the system
- SCANF ctlstr -read the string at the current cursor position (see below)
- SCREENBOTTOM -move the cursor to the bottom of the screen
- SCREENTOP -move the cursor to the top of the screen
- SCROLLDOWN -scroll the file one line up the screen. The cursor is not moved.
- SCROLLUP -scroll the file one line down the screen. The cursor is not moved.
- SET var str -initialize or change an internal variable
- SETENV var str -initialize or change an environment variable (ENV:)
- SETFONT font size-change the window font (eg: setfont topaz.font 11)
- SETPATTERN pat -set pattern for File-Requester
- SETTOGGLE toggle -set a toggle (see below)
- SOURCE file -interpret a script file
- SPLIT -splits a line at the current column
- SWAPCHAR -swaps the character under the cursor with the one to the right of it
- SWAPMARK -PUSHMARK, swap the top two blocks marked in memory, POPMARK
- TAB -Move one tab position to the right
- TABINDENT -Indents a line to the next tab stop (see TABSTOP)
- TABSTOP n -sets tab stops at every 'n' columns
- TABUNINDENT -unindents a line by one tab stop (see TABSTOP)
- TITLE string -changes the string in the title bar of the window
- TLATE [+/-]n -adds or subtracts the value 'n' to the ascii value of the character
- under the cursor
- TMPHEIGHT n -changes the height to be used for the next window opened
- TMPLEFT n -changes the leftedge to be used for the next window opened
- TMPTOP n -changes the topedge to be used for the next window opened
- TMPWIDTH n -changes the width to be used for the next window opened
- TOGGLE toggle -flips the setting of the given toggle (see below)
- TOMOUSE -move the cursor to the mouse position
- TOP -jump to the beginning of the text
- TOPEDGE n -changes the position of the top of each new window to 'n' pixels
- UNBLOCK -removes the current block markings
- UNDELINE -recalls a line previously deleted with DELINE
- UNDO -undoes changes to the current line (this must be mapped to a key
- in order to work.) Moving the cursor off of the line makes the
- changes permanent.
- UNINDENT -unindents a line by one column (see INDENT below)
- UNJUSTIFY -removes neighboring spaces from the text, to unjustify a justified
- paragraph.
- UNMAP key -deletes mapping of a key
- UNSET var -removes an internal variable
- UNSETENV var -removes an environment variable (ENV:)
- UP -move the cursor up a line
- WHILE cnd act -(see below)
- WIDTH n -change the width of all new windows to 'n' pixels
- WLEFT -move to the beginning of the previous word. If the cursor is within
- a word, the cursor then moves to the beginning of this word.
- WRIGHT -jump to the beginning of the next word.
-
- NOTES
- *)
- PONG can also jump to another edit window. If you are running a
- mouse utility that activates the window under the mouse pointer
- (such as the DMouse AutoPoint feature) this function won't give
- you the desired effect. The same goes for NEXTWIN and PREVWIN.
-
- **)
- Input/Output uses the StdIn/StdOut of AmokEd's process. If you
- don't want this, you'll have to redirect it from/to NIL:. If
- AmokEd is started via 'run >nil: <nil:' or from Workbench, there
- will be no StdIn/StdOut.
-
-
- ---------- Further information for the complex commands ------------
-
- INDENT - moves a line in as many characters further than the
- closest previou less indented line as that line is
- indented from the beginning of the line. (I love
- German :-)
-
- Example:
- 0.2.4
- | Line 1 <- This line is less indented than line 3
- | Line 2 <- This line is not less indented than line 3
- | Line 3 <- This is where the cursor is
-
- After the first INDENT:
- 0.2.4.6.8.
- | Line 1
- | Line 2 <- This line is now less indented than line 3
- | Line 3 <- The cursor is still here
-
- After another INDENT:
- 0.2.4.6.8.0.2.4.
- | Line 1
- | Line 2
- | Line 3
-
- UNINDENT - Unindents a line so that it is at the same indentation as the
- closest previous less indented line.
-
- Example:
-
- | Line 1
- | Line 2 <- This line is less indented than line 3
- | Line 3 <- The cursor is on this line
-
- After the first UNINDENT:
- 0.2.4.6.8.
- | Zeile 1 <- This is now the less indented line
- | Zeile 2
- | Zeile 3 <- The cursor is still here
-
- After the second UNINDENT
- 0.2.4.6.8.
- | Zeile 1
- | Zeile 2
- | Zeile 3
-
- MENUOFF - These commands enable or disable the pulldown menus
- MENUON For people who put a lot of MENUADD commands in their
- '.aedrc' file, it may be useful to know that if you
- first turn off the menus, that the MENUADD command
- will operate noticeably faster. (There after you can
- naturally turn the menus back on!)
-
- The commands can be nested. In other words, if you
- use MENUOFF twice, then you will need to use MENUON
- twice to enable the menus again. (Of course it doesn't
- work the other way around.)
-
- CHECKRESET - Here it is important to note that simply activating a
- CHECKSET toggle menu item doesn't cause the menu item checkmark
- CHECKTOGGLE to change. That makes it easy to use the equivalent
- keyboard key to implement the menu function.
-
- Example:
- menuaddt test test c-help
- map c-help (toggle 5 checktoggle test-test)
-
- Mutual exclusion is also possible. For example:
- menuaddt test test1 -help
- menuaddt test test2 s-help
- map -help (checkreset test-test2 checkset test-test1)
- map s-help (checkreset test-test1 checkset test-test2)
- map c-help (checktoggle test-test1 checktoggle test-test2)
-
- SCANF ctlstr - This command is similar to the C-function scanf(). At
- this point only string variables can be scanned. The
- function if mostly used in coordination with the CTAGS
- command (woefully omitted from this distribution).
-
- REPEAT n arg - Repeat the commands in <arg> 'n' times.
-
- In addition to a strict number, the following values can
- be used:
-
- line the current line number (lines begin with 1)
- lbot the lines to the last line in the text
- cleft the current column number (columns begin with 0)
- cright the number of columns to the right of the
- cursor until the end of the line, including
- the character under the cursor.
- tr the number of characters to the next tab stop.
- tl the number of characters to the previous tab
- stop
- wlinetop the number of lines to the window's top
-
- Different commands can abort the repeat-loop. Each
- FIND, FINDR, NEXT, NEXTR, PREV, and PREVR in which the
- search is unsuccessful will stop the loop (and the
- macro.) The same thing happens with commands that
- try to move beyond the limits of the file (e.g: UP,
- DOWN, LEFT, RIGHT, ...)
-
- Naturally, ABORT also terminates the macro.
-
- If you specify -1 for 'n', the repeat will continue
- essentially for ever ($7fffffff times to be precise,
- which should suffice for most anything), or until the
- loop aborts for some reason.
-
- Example: Search and replace through the entire text
- (what is better done with MULTIREPLACE :-)
-
- map c-R (escimm (findstr ) escimm (repstr ) repeat -1 nextr)
-
- IF [!]condition arg
- WHILE [!]condition arg
- IFELSE [!]condition ifarg elsearg
-
- - If the given condition is satisfied, the argument is
- passed on to the interpreter. For IFELSE if the
- condition is not satisfied the 'elsearg' is then
- executed. For WHILE, the argument is executed so
- long as the condition is satisfied (Careful!).
-
- If a '!' is included, the logic is inverted.
-
- Conditions:
-
- [i]# Kippschalter [i]# gesetzt (siehe unten)
- t the cursor is on line 1
- b the cursor is on the last line
- l the cursor is in column 0
- r the cursor is at the end of the line (only white
- space remains underneath and to the right)
- m the text has been modified
- i insert mode is on
- x[<=>]# the cursor is in column # (beginning with 1) (see NOTE)
- y[<=>]# the cursor is in line # (begining with 1) (see NOTE)
- cl the cursor character is lower case. ('a'..'z')
- cu the cursor character is upper case. ('A'..'Z')
- ca the cursor character is alphanumeric.
- ('A'..'Z', 'a'..'z', '0'..'9', '_', 192..255)
- cn the cursor character is a number
- c[<=>]# the cursor character has an ascii value '#' (see NOTE)
- cb the cursor is inside the marked block
-
- NOTE:
- comparisons use either a single symbol, or a
- combination of the symbols '<', '=' and '>'
- followed by a decimal value. (eg: y=>23).
-
- if c<32 .. Character under the cursor is less than 32.
- if c<>32 .. Character under the cursor isn't 32.
- if !c=32 .. ditto
- while !b down
-
- Example: Simulation of an insertmode toggle switch.
-
- map a-i (ifelse 0 (toggle 0 settoggle insertmode)
- (toggle 0 resettoggle insertmode))
-
- Example: As long as there are lower case letters, make them
- upper case, and move to the right.
-
- map c-U (while cl (tlate -32 right)
-
- ICONIFY - This is a special capability of AmokEd:
-
- The text window is reduced to a title line. This way
- you can keep several windows open, and still be able
- to find one quickly.
-
- * The old window position and size is remembered.
- * The position of the iconified window is remembered
- for future iconifying.
-
- TOGGLE toggle
- SETTOGGLE toggle
- RESETTOGGLE toggle
-
- - This command changes the state of the toggles.
-
- There are 256 global toggles, that retain their
- values throughout AmokEd. There are also 16 toggles
- maintained separately for each of the text windows.
- In addition there are also several special toggles
- which for example change the insert mode.
-
- In all, these are the toggles that exist:
-
- i0..i15 private toggles for each text
- 0..255 global toggles
- wordwrap automatic line breaking
- insertmode insert mode (also private)
- savetab save file with ASCII Tab Characters (see below)
- (also private)
- modified modified status of the file (also private)
- numlock status of the number lock for the numeric
- keyboard
- ignorecase ignore case when using FIND, FINDR, etc.
- saveicons save texts ans configs with icon
-
-
- OBERROR action
-
- Errorsupport for AmigaOberon. This function is only
- usable if the oberonsupport.library is installed. This
- lib will come with the next release of AmigaOberon, but
- can be found on AMOK#72 as well.
- On AMOK#69 there is a version, too, but that one is
- buggy.
-
- action: read read the error file and show first error
- first show first error
- next show next error
- prev show previous error
- current show current error again
-
-
- --------------------------
- ---------- III -----------
- ---------- Key Maps -----------
- --------------------------
-
- In section II we learned how to program AmokEd (yeah I think program
- is the right word for it.) It starts getting really interesting when
- these programs are attached to keyboard keys. There are three ways of
- doing this:
-
- 1. The keymap is best kept in a '.aedrc' file, which includes keymaps
- menu definitions, and initializations.
- 2. If you want to change a mapped key while AmokEd is running (perhaps
- you would like to type in the word `Rübennase' quite often) you can
- use the MAP command in the command line.
- 3. If you would like to keep the new macro definition in your '.aedrc'
- file just press 'a-S' and all your macros will be written out!
-
- THE KEYBOARD
-
- Unlike many other editors, any key on the keyboard can be remapped
- with or without qualifiers. Qualifier here means keys such as <Shift>,
- <Ctrl>, <Amiga>, or the mouse buttons.
-
- In fact if is only by convention that the <Return> key is mapped to
- the RETURN function, and the <Up> key to UP. However if it were your
- preference, you could redefine every key to your own definitions.
-
- Keys are labeled by according to their surfaces with a few exceptions:
-
- * Backspace (the left arrow next to delete) is called 'bs'.
- * The numerical keypad keys are preficed with 'nk' except for the
- <Enter> key which is called 'enter'.
- * The four cursor keys are called 'up', 'down', 'left', and 'right'.
- * The mouse buttons are both qualifiers and keys. As keys their names
- are 'lmb', 'mmb', 'rmb'.
-
- Key maps
-
- Keys can be remapped using the MAP command (see above)
-
- Keys are specified using the folliwing syntax:
-
- [qual-]<key> qual: an optional combination of qualifier keys
- followed by a dash.
- key: keyboard key name.
-
- Qualifier: `a' <Alt>
- `s' <Shift>
- `c' <Ctrl>
- `A' <Amiga>
- `L', `M', `R' Mouse buttons (mouse buttons can be used
- as both qualifiers and as keys)
-
- --- Examples ---
-
- tab <Tab>
- -tab <Tab>
- a-a <Alt>a
- a-A <Alt>A
- A-a <Amiga>a
- sA-a <Shift><Amiga> a
- s-tab <Shift><Tab>
- c-tab <Ctrl><Tab>
- ac-? <Alt><Ctrl>?
- s-f5 <Shift><F5>
- nk0 <NumericKeypad 0>
- cs-nk0 <Ctrl><Shift><NumericKeypad 0>
- s-. <Shift>. ('>' on U.S. keyboards)
- L-f10 <LeftMouseButton><F10>
- L-lmb <LeftMouseButton><Click>
- L-mmove <LeftMouseButton><Drag>
- LR-lmb <RightMouseButton><LeftMouseButton><Click>
-
- -----------------
-
- MOUSE BUTTONS
-
- The mouse buttons can be used as keys as well as qualifiers. As keys
- they can be mapped. Their names are 'lmb', 'mmb', and 'rmb'.
-
- The standard map is as follows:
-
- L-lmb TOMOUSE Move the cursor to the mouse when the left mouse
- button is pressed
- R-rmb ICONIFY Iconify the window (only if the menu is turned off).
-
- Holding down the left mouse button while moving causes the cursor to
- follow the mouse.
-
- Mouse button mapping
-
- Because mouse buttons can be used as qualifiers as well as keys, they
- can be used to modify the action of a keyboard character as follows:
-
- map L-a ((Left mousebutton with `a'))
-
- or they can be used to perform a function in and of themselves:
-
- map L-lmb ((Left mousebutton as a key))
-
- Note that when defining a mouse button as a key, both the qualifier
- and the key names must be used (you can't get the left mouse button
- key pressed without activating the qualifier 'L').
-
- If you map both the mouse button, and some function with the mouse
- button as a qualifier, you should remember that the first function will
- always be carried out (when the button is pressed), and the second will
- occur afterwards:
-
- map L-lmb (tomouse)
- map L-a ((Hello))
-
- To simplify things it would be a good idea to delete the default mapping
- of 'rmb' (ICONIFY) if you want to use it as a qualifier key.
-
- When the mouse is in motion a further key is available. The key name
- 'mmove' can be used with the qualifiers 'L', 'M', 'R' to perform a function
- while the mouse is being moved:
-
- map L-mmove ((Mouse moved with left mouse button pressed))
- map LR-lmb ((Left mouse button clicked while right mouse button pressed))
-
- How about this: The characters under the cursor are translated to upper case
- as long as the mouse is being moved.
-
- map LR-mmove (tomouse if cl (tlate -32))
-
-
- POINTERS (no pun intended)
-
- Typically Amiga mouses have only two buttons. These are the left and
- right buttons (LMB, RMB - logical!). Three button mouses are also
- supported.
-
- Each button can be modified by a combination of the keys: <Shift>,
- <Alt>, <Ctrl>, <Amiga> and the three mouse buttons. That makes
- seven qualifiers (six if you have the usual mouse) for a total of
- 128 combinations of each key (again 64 for the two button mouse.)
-
- The <CapsLock> key is equivalent to <Shift> for the alphabetic keys
- when lit.
-
- The <Alt><Amiga> key is intercepted by Intuition and translated to
- the equivalent of a left or right mouse button. Other <Amiga> key
- combinations are also caught and interpreted by intuition independently
- of this program. Some other key combinations may not be available
- due to other programs running on the system.
-
- The standard Keymap
-
- All normal ASCII keys are mapped to their equivalent ASCII values.
- The <Bs>, <Del>, <Up>, <Down>, <Left>, <Right>, <Tab>, <Shift><Tab>,
- and <Enter> keys should all have the expected effect. The rest
- are defined as follows:
-
- map (a-c) (bcopy)
- map (a-d) (bdelete)
- map (a-down) (scrolldown)
- map (a-l) (while cu (tlate +32 right))
- map (a-m) (bmove)
- map (a-r) (nextr)
- map (a-s) (bsource)
- map (a-u) (while cl (tlate -32 right))
- map (a-up) (scrollup)
- map (bs) (bs)
- map (c-/) (escimm (find ))
- map (c-]) (ref)
- map (c-[) (ctags)
- map (c-1) (goto block)
- map (c-b) (block)
- map (c-c) ()
- map (c-del) (remeol)
- map (c-down) (pagedown)
- map (c-esc) (recall)
- map (c-f) (reformat)
- map (c-g) (escimm (goto ))
- map (c-i) (insertmode on)
- map (c-j) (join)
- map (c-l) (wleft)
- map (c-n) (next)
- map (c-o) (insertmode off)
- map (c-p) (prev)
- map (c-q) (quit)
- map (c-r) (wright)
- map (c-s) (split first down)
- map (c-u) (unblock)
- map (c-up) (pageup)
- map (c-w) (wordwrap toggle)
- map (del) (del)
- map (down) (down)
- map (enter) (return)
- map (esc) (esc)
- map (f1) (escimm (insfile ))
- map (f10) (saveold quit)
- map (f2) (escimm (newfile ))
- map (f3) (escimm (newwindow newfile ))
- map (f6) (saveold iconify)
- map (f7) (escimm (bsave ))
- map (f8) (saveold escimm (newfile ))
- map (f9) (saveold)
- map (L-lmb) (tomouse)
- map (L-mmo) (tomouse)
- map (left) (left)
- map (R-rmb) (iconify)
- map (return) (return insline up firstnb down)
- map (right) (right)
- map (s- ) (( ))
- map (s-del) (deline)
- map (s-down) (bottom)
- map (s-left) (first)
- map (s-right) (last)
- map (s-tab) (backtab)
- map (s-up) (top)
- map (sa-s) (unblock block block bsource)
- map (tab) (tab)
- map (up) (up)
- map `a-)' (`:-)') ...a standard smiley face :-)
-
-
- -------------------------------
- ---------- VI ----------
- ---------- ARexx Support ----------
- -------------------------------
-
- From AmokEd you have access to the full functionality of ARexx.
- In addition there are several commands that can only be used from
- ARexx or an ARexx program. (e.g: ReturnValue)
-
- ARexx macro activation
-
- There are three ways to activate an external ARexx Macro:
- * The commands RX, RX1, and RX2 call an ARexx macro with the macro
- name as the first argument, and zero to two arguments for the
- macro following. If you need more than two arguments, just use
- RX1, and put all of the arguments in parentheses. Eg:
- rx demo
- rx1 renumcomproc 119
- rx2 DelAllAsterix 23 28
- rx1 MakroMitVielenArgs (1 2 3 4 5 6 7)
-
- * The second possibility is to simply place the ARexx command on a
- command line with the arguments after it. If AmokEd encounters
- a command it doesn't know how to deal with, the default action is
- to pass it on to ARexx. The rest of the command line is passed
- along with the command name. The same is true for macro keys, but
- it is better to use the RX commands when activating ARexx from a
- mapped key. Eg:
- MakroMitVielenArgs 1 2 3 4 5 6 7
-
- * The command RXS allows you to type in ARexx commands directly. In
- this case the argument is not interpreted as a macro name, rather
- it is given to ARexx as a command string (see 'stringfile' in the
- ARexx Manual). Eg:
- rxs (address command 'copy #? ram:')
-
- From ARexx Macros, commands can be sent to AmokEd as usual. Using
- the return value 'rc' (in ARexx) you can determine if the desired
- action was completed successfully. For more information please refer
- to the AmokEd ARexx documentation.
-
- Controlling AmokEd from ARexx
-
- AmokEd will let itself be controlled from external ARexx macros, that
- haven't been activated from within AmokEd. To do so you (or your
- macro) will need to know the name of the ARexx port beloging to the
- copy of AmokEd with which it wants to talk. This port name is avail-
- able in the variable $rexxport, since it may be generated to be
- unique (see above).
-
- If you have only one AmokEd program active, and have RexxArpLib
- installed, you can use:
- rxs (setenv rexxport $rexxport)
-
- Export the name of the AmokEd ARexx-Port to an ARexx environment
- variable for use by external programs. Better options are available
- for some applications. (see below).
-
- There is a special ARexx command that is only available through the
- ARexx-Port:
-
- GetVal - Returns the requested variable value.
-
- Example: The AEd-Command
- rxs (options results; getval $rexxport; say result)
-
- Shows the name of the AEd-RexxPort on the to the stdout file.
-
- More information about ARexx and AmokEd is available in the AmokEdARexx
- documentation.
-
-
- --------------------------------
- ---------- VII ----------
- ---------- The Application Port ----------
- --------------------------------
-
- A further improvement in AmokEd is the application port. By using this
- port you can talk directly to any application which supports an ARexx
- interface.
-
- The application has to register itself with AmokEd. To do so you just
- need to give it the name of the port with which it is to communicate which
- can be found in the variable $rexxport.
-
- Starting the application from AmokEd is quite easy:
- execute (run <nil: >nil: AmokEd:ApplDemo $rexxport)
-
- Note that the application has been run in the background. This is
- very important because AmokEd waits for the EXECUTE command to complete
- before continuing.
-
- Next the application should register with AmokEd and inform it of the
- application port name under which it can be reached. When that has
- happened, the can be used quite easily:
-
- * Just put the application name int the command line. The rest of the
- line is treated as arguments to the application port. (Just as with
- ARexx.)
- * The APPL command can be used like the RX1 command to call functions
- in the application with one argument. This is the appropriate way
- to activate the application commands from keyboard macros:
- ApplDemo Hey There! -- from the command line
- appl ApplDemo (Hey There!) -- from a macro
-
- More precise information is application dependent. Check the manuals
- for the programs you want to communicate with for the functions and
- parameters available through its ARexx port.
-
- For everything else - Programming etc. - please look under the
- special documentation.
-
- ---------------------------------------------------------------------------
-
- [Translator's Note: Several descriptions throughout this document have
- been fleshed out a bit. It is hoped that this will help to diminish
- some of the confusion present in the original text]
-
- +++hartmut
-
- ---------------------------------------------------------------------------
- Release Notes:
-
- Legend: + added, - removed, ^ improved
-
- V1.30 - 09 Aug 1992 (release)
- + supports reading file packe with a XPK-Lib (and so PowerPacker)
- + MATCHBRACKET
- + OberonSupport (throwed all prinziples aside not to build in
- language dependant stuff, but it was _very_ cheap)
- + BusyPointer, system requester come up on AmokEd's screen
- + AppMenuItem (if not on WB screen), AppWindow
- + toggle: SaveIcons
- + save with icons, defaults: ENV:AmokEd/def_(text|config).info
- + ToolType/Shell-Option: NOAPPMENU
- · iconified window has Depth- and Zoom-Gadget
- · Portname and ScreenName are made unique if necessary
- · build in some requesters (e.g. VERSION, load inquiry)
- - bug in FIND
- - bug: dead keys haven't been working
-
- V1.29 - 19 Jun 1992 (intern)
- ^ revised WordWrap and Reformat again:
- ^ in insert mode the will be a line-proof only if the line is
- full:
- |blafasel * | * Cursor inserting a charakter here
- |jdf jdfjjdjf dfl | will not proof the lines
- ^ margin
- · in insertmode the will be only a line-proof till the lines
- allign, using REFORMAT till paragraph ending (now work like
- this)
- - bugs in parser
- · iconified windows below each other
- · gadgets as BOOPSI gadgets (GadTools not suitable for my needs)
- · 'IF cl', 'IF cu' know umlauts
-
- V1.28 - 04 Mai 1992 (internal)
- + Variablen: $winleft, $wintop, $winwidth, $winheight,
- $tmpleft, $tmptop, $tmpwidth, $tmpheight,
- $screenname, $portname (will relapce $rexxport)
- + TMPLEFT, TMPTOP, ARPSAVECONFIG
- ^ completly new configuration file format (IFF)
- · $rexxport obsolete
- · new memory management: avaiods MungWall hits
- · does no longer source S:.aedrc/.aedrc but only file stated in the
- config
- · search order for config files like StyleGuide (but not exactly)
- · scroller as GadTools gadget
-
- V1.27 - 16 Apr 1992 (internal)
- · chnges shell parmeters (besides 'cause of DOS and StyleGuide)
- · REMBOL is now REMSOL (SytleGuide!)
- · variable are stored in the local shell environment
- - Bug: (iconify newwindow arpload) -> crash
-
- V1.26 - 14 Apr 1992 (internal)
- · after execution of an ARexx marco the texts dir lock is taken
- form the process' current dir
- - fixed problem with the new locking mechanism
-
- V1.25 - 16 Apr 1992 (small release)
- IMPORTANT: AmokEd now needs AmigaOS2.0 or higher!!
- - Bug: Pattern has been overwritten (ony in the release :-(
- + template for ReadArgs.
- · NumLock now only for unqualified keys
- + PubScreens
- AmokEd opens its screen as public screen (with the geven name)
- and can open its windows on a given screen, default: worckbench
- screen
- ^ cond. for REPEAT: lwintop = numo lines to window top
- + SETPATTERN: sets pattern for file requester
- + by `IF m' and `$modified' the line will be written back, so the
- asked status the the real
- - Bug: scrolled to the right, if outside the proper window but not
- onto the the scroller
- + new variable: $path holds the complete path for the files
- directory
- · $filename now only hold the filepart
- · The current dir of AmokEd is now always the dir lock of the text
- · WordWrap now only breaks the line written, no longer the
- following are pulled up
- Reformat works as usual.
- · ToolTypes support (ToolType for WINDOW will be changed soon)
- - Bug: while MultiReplace it was possible to move the cursor
- around and replace at the wrong place
-
- V1.20c - 09 Feb 1992
- + Justify, Unjustify
- + new variables: $margin, $modified, $currentline
- + Modifed schaltbat (mittels *Toggle)
- + GotoCol
- ^ Scrollbar now fully functional :-) Thanks to Tobias Ruland
- - Bug in the Rexx routiens (Volkers SPrintf is subject to errors)
- - Bug in BDelete: bad column number, if Block = EndofText
- - Bug in *Toggle: title has not been saved
-
- V1.12 - 25 Dec 1991
- + MenuAddT: MenuItem with CheckMark
- + MenuAddSep
- + CheckSet, CheckRest, CheckToggle: Toggle for the CheckMarks
- + Insert, Overwrite: ability to add text independent of insertmode
- + NextWin, PrevWin: moves the windows to the front in order
- + Cursor only halfheight in overwrite mode
- + CaseInsensitive Find/Replace
- + Indent, Unindent, TabIndent, TabUnindent
- + Turbo-Mode for Multireplace (without Screen-Update)
- Time comparison: in Intuition.mod # -> * (before * -> #)
- mrplc all 1 min 35 sec.
- mrplc turbo 17 sec.
- + NoScrUpdate
- + ArpSoure
- + RemBOL
- + ASCII
- - Toggle: AutoIndent (better controlled by Indent/TabIndent)
- - Bugs dReformat
- - Bug: m-mmb didn't work
- - lots of little bugs
- MinWidth can't be exceeded any longer
- ^ PropGadget and WinHeight now still correct for large fonts
- ^ PropGadget under 2.0 in NewLook, under 1.3 as before
- ^ AprSave uses ASL-SaveReq (if ASL is available)
-
- V1.02b - 21 Oct 1991
- - Bug in ArpLoad (File/path-Split)
-
- V1.02 - 19 Oct 1991
- older release notes removed
-
-